package main

import (
	"flag"
	"log"
	"net/http"
	"os"
)

var dir string
var port string

func main() {
	getwd, _ := os.Getwd()
	flag.StringVar(&dir, "d", getwd, "dir")
	flag.StringVar(&port, "p", "8080", "port")
	flag.Parse()
	http.Handle("/", http.FileServer(http.Dir(dir)))
	log.Println("Listening on "+dir, "port "+port)
	http.ListenAndServe(":"+port, nil)
}
